<?php
// +----------------------------------------------------------------------
// | 有小象汇 自研正版源码 赋能开发者
// +----------------------------------------------------------------------
// | Copyright (c) 2017~2023 http://www.uxphp.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed 有小象汇并不是自由软件，未经许可不能去掉有小象汇相关版权
// +----------------------------------------------------------------------
// | Author:  有小象汇
// +----------------------------------------------------------------------
use think\facade\Route;

/**
 * 城市模块 相关路由
 */
Route::group('base',function (){
    /** 城市 */
    Route::group(function () {
        Route::get('city','v1.car.BaseCity/getList')->option(['real_name'=>'列表']);
        Route::get('city/list','v1.car.BaseCity/getCityList')->option(['real_name'=>'城市列表']);
        Route::get('city/add/:id','v1.car.BaseCity/add')->option(['real_name'=>'添加/修改']);
        Route::put('city/set_show/:id/:status', 'v1.car.BaseCity/setShow')->option(['real_name' => '显示/隐藏']);
        Route::post('city/save','v1.car.BaseCity/save')->option(['real_name'=>'添加/修改保存']);
        Route::delete('city/del/:id', 'v1.car.BaseCity/delete')->option(['real_name' => '删除']);
    });
    /** 地点 */
    Route::group(function () {
        Route::get('place','v1.car.BasePlace/getList')->option(['real_name'=>'地点列表']);
        Route::get('place/label','v1.car.BasePlace/label')->option(['real_name'=>'地点标签']);
        Route::put('place/set_show/:id/:status', 'v1.car.BasePlace/setShow')->option(['real_name' => '地点显示/隐藏']);
        Route::get('place/getPlaceInfo/:id', 'v1.car.BasePlace/getPlaceInfo')->option(['real_name' => '地点详情']);
        Route::get('place/place_cascader', 'v1.car.BasePlace/placeCascader')->option(['real_name' => '获取地点级联数据']);
        Route::get('place/select_list', 'v1.car.BasePlace/selectPlaceList')->option(['real_name' => '地点下拉列表']);
        Route::get('place/getStoreList', 'v1.car.BasePlace/getStoreList')->option(['real_name' => '门店下拉列表']);
        Route::post('place/add','v1.car.BasePlace/add')->option(['real_name'=>'添加/修改']);
        Route::delete('place/del/:id', 'v1.car.BasePlace/delete')->option(['real_name' => '地点删除']);
    });
    /** 网点 */
    Route::group(function (){
        Route::get('getOutletList','v1.car.BasePlace/getOutletList')->option(['real_name'=>'网点列表']);
        Route::put('switchOutlet/:id/:status', 'v1.car.BasePlace/switchOutlet')->option(['real_name' => '显示/隐藏']);
        Route::post('outletAdd', 'v1.car.BasePlace/outletAdd')->option(['real_name' => '添加/修改']);
        Route::delete('outletDelete/:id', 'v1.car.BasePlace/outletDelete')->option(['real_name' => '网点删除']);
    });

    /** 操作日志 */
    Route::group(function () {
        Route::get('log','v1.car.BaseLog/getList')->option(['real_name'=>'列表']);
    });
    /** 跨城取还车 */
    Route::group(function () {
        Route::get('cityFee','v1.car.BaseCityFee/getList')->option(['real_name'=>'列表']);
        Route::get('cityFee/add/:id','v1.car.BaseCityFee/add')->option(['real_name'=>'添加/修改']);
        Route::post('cityFee/save','v1.car.BaseCityFee/save')->option(['real_name'=>'保存']);
        Route::delete('cityFee/del/:id', 'v1.car.BaseCityFee/delete')->option(['real_name' => '删除']);
    });
    /** 上门取还车 */
    Route::group(function () {
        Route::get('sendFee','v1.car.BaseSendFee/getList')->option(['real_name'=>'列表']);
        Route::get('sendFee/add/:id','v1.car.BaseSendFee/add')->option(['real_name'=>'添加/修改']);
        Route::post('sendFee/save','v1.car.BaseSendFee/save')->option(['real_name'=>'保存']);
        Route::delete('sendFee/del/:id', 'v1.car.BaseSendFee/delete')->option(['real_name' => '删除']);
    });
    /** 用户反馈 */
    Route::group(function () {
        Route::get('suggest/getList','v1.car.BaseSuggest/getList')->option(['real_name'=>'获取列表']);
        Route::get('suggest/dispose/:id','v1.car.BaseSuggest/suggestDispose')->option(['real_name'=>'处理反馈']);
        Route::delete('suggest/del/:id', 'v1.car.BaseSuggest/del')->option(['real_name' => '删除']);
        Route::post('suggest/save', 'v1.car.BaseSuggest/save')->option(['real_name' => '保存']);
    });
})->middleware([
    \app\http\middleware\AllowOriginMiddleware::class,
    \app\adminapi\middleware\AdminAuthTokenMiddleware::class,
    \app\adminapi\middleware\AdminCheckRoleMiddleware::class,
    \app\adminapi\middleware\AdminLogMiddleware::class
]);
Route::group('car', function () {
    /** 联系人 */
    Route::group(function () {
        Route::get('contact','v1.car.CarContact/getList')->option(['real_name'=>'联系人列表']);
        Route::get('contact/add/:id','v1.car.CarContact/add')->option(['real_name'=>'添加/修改']);
        Route::post('contact/save','v1.car.CarContact/save')->option(['real_name'=>'添加/修改保存']);
        Route::post('audi_save','v1.car.CarContact/auditSave')->option(['real_name' => '资质审核']);
        Route::delete('contact/del/:id', 'v1.car.CarContact/delete')->option(['real_name' => '删除']);
    });
    /** 车辆品牌 */
    Route::group(function () {
        Route::get('brand','v1.car.CarBrand/getList')->option(['real_name'=>'列表']);
        Route::get('brand/list','v1.car.CarBrand/getBrandList')->option(['real_name'=>'品牌列表']);
        Route::get('brand/add/:id','v1.car.CarBrand/add')->option(['real_name'=>'添加/修改']);
        Route::put('brand/set_show/:id/:status', 'v1.car.CarBrand/setShow')->option(['real_name' => '显示/隐藏']);
        Route::post('brand/save','v1.car.CarBrand/save')->option(['real_name'=>'添加/修改保存']);
        Route::delete('brand/del/:id', 'v1.car.CarBrand/delete')->option(['real_name' => '删除']);
    });
    /** 车辆分类 */
    Route::group(function () {
        Route::get('category','v1.car.CarCategory/getList')->option(['real_name'=>'列表']);
        Route::get('category/list','v1.car.CarCategory/getCategoryList')->option(['real_name'=>'分类列表']);
        Route::get('category/add/:id','v1.car.CarCategory/add')->option(['real_name'=>'添加/修改']);
        Route::put('category/set_show/:id/:status', 'v1.car.CarCategory/setShow')->option(['real_name' => '显示/隐藏']);
        Route::post('category/save','v1.car.CarCategory/save')->option(['real_name'=>'添加/修改保存']);
        Route::delete('category/del/:id', 'v1.car.CarCategory/delete')->option(['real_name' => '删除']);
    });
    /** 车型 */
    Route::group(function () {
        Route::get('type','v1.car.CarType/getList')->option(['real_name'=>'列表']);
        Route::get('type/list','v1.car.CarType/getTypeList')->option(['real_name'=>'车型列表']);
        Route::get('type/add/:id','v1.car.CarType/add')->option(['real_name'=>'添加/修改']);
        Route::put('type/set_show/:id/:status/:type', 'v1.car.CarType/setShow')->option(['real_name' => '显示/隐藏']);
        Route::get('type/place/list', 'v1.car.CarType/getType')->option(['real_name' => '车型门店下拉列表']);
        Route::get('type/store_car','v1.car.CarType/storeCar')->option(['real_name'=>'门店车型']);
        Route::post('type/save','v1.car.CarType/save')->option(['real_name'=>'添加/修改保存']);
        Route::delete('type/del/:id', 'v1.car.CarType/delete')->option(['real_name' => '删除']);
    });
    /** 车辆信息 */
    Route::group(function () {
        Route::get('info','v1.car.CarInfo/getList')->option(['real_name'=>'列表']);
        Route::get('info/all','v1.car.CarInfo/getCarInfoAll')->option(['real_name'=>'全部车辆信息']);
        Route::put('info/set_show/:id/:status', 'v1.car.CarInfo/setShow')->option(['real_name' => '显示/隐藏']);
        Route::post('info/add','v1.car.CarInfo/add')->option(['real_name'=>'添加/修改']);
        Route::post('info/save','v1.car.CarInfo/save')->option(['real_name'=>'添加/修改保存']);
        Route::delete('info/del/:id', 'v1.car.CarInfo/delete')->option(['real_name' => '删除']);
        Route::delete('info/delete','v1.car.CarInfo/infoDelete')->option(['real_name'=>'批量删除']);
    });
    /** 保险服务 */
    Route::group(function () {
        Route::get('service/getList','v1.car.CarService/getList')->option(['real_name'=>'获取列表']);
        Route::put('service/status/:id/:status','v1.car.CarService/status')->option(['real_name','是否显示']);
        Route::get('service/add/:id','v1.car.CarService/add')->option(['real_name'=>'添加/修改']);
        Route::post('service/save','v1.car.CarService/save')->option(['real_name'=>'添加/修改保存']);
        Route::delete('service/del/:id', 'v1.car.CarService/del')->option(['real_name' => '删除']);
    });

    /** 每日价格 */
    Route::group(function () {
        Route::get('date','v1.car.CarDate/getList')->option(['real_name'=>'列表']);
        Route::post('date/add','v1.car.CarDate/add')->option(['real_name'=>'添加']);
        Route::post('date/edit','v1.car.CarDate/edit')->option(['real_name'=>'编辑']);
        Route::delete('date/delete','v1.car.CarDate/dateDelete')->option(['real_name'=>'批量删除']);
        Route::delete('date/del/:id','v1.car.CarDate/del')->option(['real_name'=>'删除']);
    });
    /** 店员账号 */
    Route::group(function () {
        Route::get('staff/getList','v1.car.CarStaff/getList')->option(['real_name'=>'店员账号信息']);
        Route::put('staff/add/:id','v1.car.CarStaff/add')->option(['real_name'=>'获取店员信息']);
        Route::post('staff/save','v1.car.CarStaff/save')->option(['real_name'=>'修改、添加']);
        Route::delete('staff/del/:id', 'v1.car.CarStaff/del')->option(['real_name' => '删除']);
    });
    /** 车辆信息 */
    Route::group(function () {
        Route::get('type/info','v1.car.CarTypeInfo/getList')->option(['real_name'=>'列表']);
        Route::get('type/info/add/:id','v1.car.CarTypeInfo/add')->option(['real_name'=>'添加/修改']);
        Route::post('type/info/save','v1.car.CarTypeInfo/save')->option(['real_name'=>'保存']);
        Route::delete('type/info/del/:id', 'v1.car.CarTypeInfo/delete')->option(['real_name' => '删除']);
        Route::put('type/info/set_show/:id/:status/:type', 'v1.car.CarTypeInfo/setShow')->option(['real_name' => '显示/隐藏']);
        Route::get('type/info/list', 'v1.car.CarTypeInfo/getTypeInfoList')->option(['real_name' => '车型列表']);
    });
    /** 假期 */
    Route::group(function () {
        Route::get('holiday','v1.car.CarHoliday/getList')->option(['real_name'=>'列表']);
        Route::get('holiday/info','v1.car.CarHoliday/getHolidayInfo')->option(['real_name'=>'详情']);
        Route::post('holiday/add','v1.car.CarHoliday/add')->option(['real_name'=>'添加/修改']);
        Route::delete('holiday/del/:id', 'v1.car.CarHoliday/delete')->option(['real_name' => '删除']);
    });
    /** 车辆占用时间 */
    Route::group(function () {
        Route::get('occupy/time','v1.car.CarOccupyTime/getList')->option(['real_name'=>'列表']);
        Route::post('occupy_time_save','v1.car.CarOccupyTime/occupyTimeSave')->option(['real_name'=>'保存']);
        Route::get('get_occupy_time_info','v1.car.CarOccupyTime/getOccupyTimeInfo')->option(['real_name'=>'获取一条记录']);
        Route::get('view_details_info','v1.car.CarOccupyTime/viewDetailsInfo')->option(['real_name'=>'查看详情']);
        Route::delete('occupy_del/:id', 'v1.car.CarOccupyTime/delete')->option(['real_name' => '删除']);
    });
    /** 订单 */
    Route::group(function () {
        Route::get('order/get_tabs_data', 'v1.car.CarOrder/getTabsData')->option(['real_name'=>'获取订单tabs数据']);
        Route::get('order/get_order_list', 'v1.car.CarOrder/getOrderList')->option(['real_name'=>'获取订单列表']);
        Route::get('order/get_order_log', 'v1.car.CarOrder/getOrderLog')->option(['real_name'=>'获取订单日志']);
        Route::get('order/get_order_flow', 'v1.car.CarOrder/getOrderFlow')->option(['real_name'=>'获取订单流水']);
        Route::get('order/details', 'v1.car.CarOrder/getOrderInfo')->option(['real_name'=>'获取订单详情']);
        Route::post('order/order_closing', 'v1.car.CarOrder/orderClosing')->option(['real_name'=>'订单结算']);
        Route::get('order/deposit_info', 'v1.car.CarOrder/depositInfo')->option(['real_name'=>'押金详情']);
        Route::post('order/deposit_refund', 'v1.car.CarOrder/depositRefund')->option(['deposit_refund'=>'押金退款']);
    });
    /** 续租订单 */
    Route::group(function () {
        Route::get('order/rerent','v1.car.CarOrderRerent/getList')->option(['real_name'=>'列表']);
        Route::get('order/get_rerent_info','v1.car.CarOrderRerent/getRerentInfo')->option(['real_name'=>'详情']);
        Route::post('order/consent_apply_for','v1.car.CarOrderRerent/consentApplyFor')->option(['real_name'=>'审核']);
    });
    /** 单面收费与扣款 */
    Route::group(function () {
        Route::get('order/detail','v1.car.CarOrderDetail/getList')->option(['real_name'=>'列表']);
        Route::get('order/car_charge_type','v1.car.CarOrderDetail/carChargeType')->option(['real_name'=>'收费类型']);
    });
    /** 退款订单 */
    Route::group(function () {
        Route::get('order/refund','v1.car.CarOrderRefund/getList')->option(['real_name'=>'列表']);
        Route::post('order/audit_refund','v1.car.CarOrderRefund/auditRefund')->option(['real_name'=>'退款审核']);
        Route::delete('order/refund/del/:id','v1.car.CarOrderRefund/delete')->option(['real_name'=>'列表']);
    });
    /** 车辆保养 */
    Route::group(function () {
        Route::get('upkeep/list','v1.car.CarUpkeep/getList')->option(['real_name'=>'列表']);
        Route::get('upkeep/add', 'v1.car.CarUpkeep/add')->option(['real_name' => '添加']);
        Route::post('upkeep/submit_upkeep_data', 'v1.car.CarUpkeep/submitUpkeepData')->option(['real_name' => '提交保养表单']);
        Route::delete('upkeep/delete/:id', 'v1.car.CarUpkeep/delete')->option(['real_name' => '删除']);
    });
    /** 车辆预约 */
    Route::group(function () {
        Route::get('book/list','v1.car.CarBook/getList')->option(['real_name' => '列表']);
        Route::delete('book/delete/:id', 'v1.car.CarBook/delete')->option(['real_name' => '删除']);
        Route::post('book/handle', 'v1.car.CarBook/handle')->option(['real_name' => '处理']);
    });
    /** 车辆类型 */
    Route::group(function () {
        Route::get('book/type/list','v1.car.CarBookType/getList')->option(['real_name' => '列表']);
        Route::get('book/type/add/:id', 'v1.car.CarBookType/add')->option(['real_name' => '添加/修改']);
        Route::post('book/type/save', 'v1.car.CarBookType/save')->option(['real_name' => '保存']);
        Route::delete('book/type/delete/:id', 'v1.car.CarBookType/delete')->option(['real_name' => '删除']);
    });
    /** 黑名单 */
    Route::group(function () {
        Route::get('blacklist/list','v1.car.CarBlacklist/getList')->option(['real_name' => '列表']);
        Route::get('blacklist/add/:id', 'v1.car.CarBlacklist/add')->option(['real_name' => '添加/修改']);
        Route::post('blacklist/save', 'v1.car.CarBlacklist/save')->option(['real_name' => '保存']);
        Route::delete('blacklist/delete/:id', 'v1.car.CarBlacklist/delete')->option(['real_name' => '删除']);
    });
})->middleware([
    \app\http\middleware\AllowOriginMiddleware::class,
    \app\adminapi\middleware\AdminAuthTokenMiddleware::class,
    \app\adminapi\middleware\AdminCheckRoleMiddleware::class,
    \app\adminapi\middleware\AdminLogMiddleware::class
]);
